//
//  GongGaoXiangQingViewController.m
//  1gene
//
//  Created by 1jiyin on 16/3/15.
//  Copyright © 2016年 1jiyin. All rights reserved.
//
//******************公告详情******************
#import "GongGaoXiangQingViewController.h"

@interface GongGaoXiangQingViewController ()

@end

@implementation GongGaoXiangQingViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor=[UIColor whiteColor];
    [self createNavigation];
    [self createUI];
    // Do any additional setup after loading the view.
}
-(void)createUI
{
    //self.navigationItem.title=@"公告";
    //标题
    UILabel *topicLab=[[UILabel alloc]initWithFrame:CGRectMake(0, 20+44+20, self.view.frame.size.width, 30)];
    topicLab.text=_dataDic[@"title"];
    topicLab.font=[UIFont systemFontOfSize:15];
    topicLab.textColor=[UIColor colorWithRed:70/255.0 green:183/255.0 blue:212/255.0 alpha:1];
    topicLab.textAlignment=NSTextAlignmentCenter;
    [self.view addSubview:topicLab];
    
    //时间
    UILabel *timeLab=[[UILabel alloc]initWithFrame:CGRectMake(self.view.frame.size.width-160, CGRectGetMaxY(topicLab.frame), 150, 20)];
    timeLab.text=_dataDic[@"public_time"];
    timeLab.textAlignment=NSTextAlignmentRight;
    timeLab.font=[UIFont systemFontOfSize:13];
    timeLab.textColor=[UIColor grayColor];
    [self.view addSubview:timeLab];
    
    //内容
    UILabel *contentLab=[[UILabel alloc]initWithFrame:CGRectMake(10, CGRectGetMaxY(timeLab.frame), self.view.frame.size.width-10-10, 0)];
    contentLab.text=_dataDic[@"content"];
    contentLab.font=[UIFont systemFontOfSize:13];
    contentLab.textColor=[UIColor blackColor];
    contentLab.numberOfLines=0;
    CGSize contentSize=[contentLab boundingRectWithSize:CGSizeMake(contentLab.frame.size.width, 0)];
    contentLab.frame=CGRectMake(10, CGRectGetMaxY(timeLab.frame), self.view.frame.size.width-10-10, contentSize.height);
    [self.view addSubview:contentLab];
    
    //标签 出资那里
    UILabel *biaoqian=[[UILabel alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(contentLab.frame)+5, self.view.frame.size.width-10, 20)];
    biaoqian.text=_dataDic[@"msg_type"];
    biaoqian.font=[UIFont systemFontOfSize:13];
    biaoqian.textAlignment=NSTextAlignmentRight;
    biaoqian.textColor=[UIColor grayColor];
    [self.view addSubview:biaoqian];
    
}
-(void)createNavigation
{
    self.navigationController.navigationBar.barTintColor=[UIColor colorWithRed:84/255.0 green:199/255.0 blue:222/255.0 alpha:1];
    //返回
    UIButton *leftBtn=[UIButton buttonWithType:UIButtonTypeCustom];
    leftBtn.frame=CGRectMake(0, 0, 25, 25);
    [leftBtn setBackgroundImage:[UIImage imageNamed:@"left_back"] forState:UIControlStateNormal];
    [leftBtn addTarget:self action:@selector(leftBtnClick:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem=[[UIBarButtonItem alloc]initWithCustomView:leftBtn];
    
    //标题
    UILabel *title=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 100, 44)];
    title.text=@"今日公告";
    title.font=[UIFont systemFontOfSize:22];
    title.textAlignment=NSTextAlignmentCenter;
    title.textColor=[UIColor whiteColor];
    self.navigationItem.titleView=title;
}
//返回上一页
-(void)leftBtnClick:(UIButton *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
